package com.blb.zy_community.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.blb.zy_community.entity.ZyBuilding;
import com.blb.zy_community.entity.ZyRoom;
import com.blb.zy_community.entity.ZyUnit;
import com.blb.zy_community.mapper.ZyRoomMapper;
import com.blb.zy_community.service.IZyRoomService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 房间  服务实现类
 * </p>
 *
 * @author 二组
 * @since 2023-06-18
 */
@Service
public class ZyRoomServiceImpl extends ServiceImpl<ZyRoomMapper, ZyRoom> implements IZyRoomService {

    @Autowired
    private ZyRoomMapper zyRoomMapper;


    @Override
    public Page<ZyRoom> selectRoomList(Page<ZyRoom> page, String unitId, String buildingId, String roomStatus,Long communityId) {

        Page<ZyRoom> zyRoomPage = zyRoomMapper.selectRoomList(page,unitId, buildingId, roomStatus,communityId);
        return zyRoomPage;
    }

    @Override
    public List<ZyBuilding> getbuildingList() {
        List<ZyBuilding> zyBuildings = zyRoomMapper.selectBuilding();
        return zyBuildings;
    }

    @Override
    public void batchDeleteIds(Long[] roomIds) {
        zyRoomMapper.deleteByRoomIds(roomIds);
    }


}
